For a multitude of useful information about the new TCL 2.0 that did not make it into the Visual Architect/TCL Guide, please refer to the "Supplementary Info.π" project in the "THINK Class Library 2.0:(Supplementary Info)" folder. The text files that make up this project include:
• a detailed discussion on how to convert existing TCL applications to TCL 2.0.
• an expanded discussion of using the CSaver class.
• descriptions of three classes not documented in the manual: CEnvirons, CFileElement, and CPictGridDirector.
• descriptions not documented in the manual of the AppleEvent-related member functions for the following classes: CApplication, CClipboard, CDocument, CSwitchboard, and CWindow.
• documentation on using ResEdit resource templates to initialize CView-derived classes from resources.
To build your old TCL 1.1.3 projects without converting to TCL 2.0, follow these steps:
• Shield the THINK Class Library 2.0, Mac #includes, Standard Libraries, and oops Libraries Folders.
• Copy the THINK Class Library 1.1.3, Mac #includes, Standard Libraries and oops Libraries Folders from the old Development Folder.
• Re-precompile TCLHeaders and TCLHeaders++.
More On Using new_by_name
-------------------------
If you wish to instantiate classes using new_by_name, you need to override CApplication::ForceClassReferences and add the following line for each class:
TCL_FORCE_REFERENCE(myClass);
If you forget to do this, you will get a failure in new_by_name when trying to instantiate your class.
NOTE: The override to CApplication::ForceClassReferences and the necessary calls to TCL_FORCE_REFERENCE are automatically generated for classes that you define using Visual Architect.
Fixed in 2.0.2
==============
• Made definition of AppleEvent in CAppleEventObject::GenericHandler
volatile in order to keep its value in the catch block.
• operator new() now correctly initializes allocated memory to
the value defined by the macro TCL_PRESET_OBJECTS in
TCL #includes.cp.
• CFile::ThrowOut() now calls Close() before deleting the file
as it did in 1.1.3.
• All references to CPP_TCL except in TCL #includes.cpp removed.
• CArray::InsertAtIndex now correctly forces out-of-range indices
into the array and InsertItem now correctly adjusts its argument
index if it is out of range, as documented. Documentation change:
InsertItem takes a long& argument instead of a long.
• Overrode SetArrayItem() in CVoidPtrArray and CPtrArray so the
latter now has a type-safe way to change the value of an item.
• Dragging windows no longer shows a munged grayrgn after a few
tries.
• PutObjectReference() added as a member function of CStream.
The template function didn't use the type T and is obsolete
(though supported until the next major release).
This saves about 100 bytes per streaming root class.
• PutObjectReference() no longer incorrectly writes a -1L instead of
a short 0 when an object hasn't already been written.
• catch_() no longer destroys the exception before returning a
pointer to it.
• CPane's ChangeSize() correctly places the frame when the
top or left is non-zero.
• Added HNoPurge to CDLOGDialog::IDLOGDialogX().
• FindDlogPosition() checks GetResource.
• CStdPopupPane's sMenuProc checks LoadResource.
• CDialogDirector::DoModalDialog() calls HiliteMenu(0) in its
exception handler in case exception thrown in Edit menu command.
• CDesktop now checks NewPtr().
• CClipboard now checks NewHandle(0).
• CBartender now calls ResizeHandleCanFail() instead of
SetHandleSize().
• CPtrArrayIterators now compile and run correctly. There was a
problem was an incorrect forward declaration of CPtrArray.
• TinyEdit new documents now show blinking cursor.
• TCL dependence on '\r' and '\n' removed for PowerPC compatibility.
Added TCL_CR macro defined as 0xD.
• It is now possible to compile demos and TCL with TCL_UNSAFE_ALLOCATION
undefined. The TCL no longer crashes after one or two out-of-memory
exceptions. All TCL_AUTO_DESTRUCT_OBJECT allocation in TCL and demos
is now done with TCL_NEW().
• Added TCL_FORCE_TEMPLATE_REFERENCE() macro to
TCLForceReferences.h and fixed bug that made it impossible to use CLists with new_by_name().
• __TCL_DebugCStr function restored to Exceptions.cp so BRLib links when
compiled with BR_DEBUG.
• CArrayIterator no longer collaborates with CArray, greatly reducing
overhead of creating iterators and making it sensible to use
an iterator inside CCollaborator.
• CCollaborator now uses iterators rather than DoForEach loops, allowing
collaborators to go away when they receive broadcasts.
Fixed in 2.0.1
==============
• All references to gLastError removed from TCL.
• Made CStream compile with any double size by adding conditional behavior
to PutFloat()/GetFloat() on mc68881 and undocumented __DOUBLE_8__ macros.
• Made alignment tests in CException.cp conditional on non-byte alignment.
HOWEVER, TCL still requires at least word alignment or exceptions don't
work.
• Variables set in try blocks and used in catch blocks or thereafter have
been made volatile or variable initialization moved out of try blocks
so catch blocks correctly use/delete storage.
• Added TCL_ZERO_OBJECTS macro which defines the value to which new objects
are initialized. Default is 0. If TCL_ZERO_OBJECTS is not defined in
TCLHeaders, objects are served raw.
• Several catch_all_() blocks were missing throw_same_().
• Added try/catch to CWindow::Update and CBartender::UpdateMenus to keep exceptions
from causing display loops and disabling menus.
• Exceptions no longer abort when a try/catch block is executed in a catch
block.
• CApplication::GrowMemory now frees only enough rainy day memory to satisfy
requests, so non-critical or can-fail allocations can't get into fund.
• CApplication::DoIdle() no longer ignores current rainyDay size when trying to
replenish the fund.
• Process monitor demo no longer tries to delete list items in a DoForEach loop. Uses an iterator, instead.
• Added __MMPrimitiveAllocate global so TCL can sense when an allocation request
is made on behalf of an external memory manager. Prevents "deadlock" caused by
memory manager stealing from rainy day fund.
• Several alert and string resources are preloaded to increase likelihood that
out-of-memory warnings are seen when memory is low.
• Added Pascal string constructors and other functions to CString.
• In CPictureButton, needsUpdate is now initialized.